App.controller('depositOrderController', ['$rootScope', '$scope', '$state', 'Page', function ($rootScope, $scope, $state, Page) {
    $scope.depositOrderGrid = {
        column_defs: [
            {
                target: 9,
                buttons: [
                    {
                        name: '校验订单',
                        clazz: 'btn btn-danger',
                        icon: 'fa-search',
                        event: 'verifyOrder'
                    },
                    {
                        name: '下载对账单',
                        clazz: 'btn green',
                        icon: 'glyphicon glyphicon-download-alt',
                        event: 'downloadFileTransfer'
                    }
                ]
            }
        ],
        add : function() {
            $scope.customer = {};
            $scope.customerAddFlag = true;
            $scope.customerAddModal.show();
        },
        verifyOrder : function(row){
        	  Page.ajaxPost('payOrder/queryOrder.do', row, function (resp) {
        		  var msg = resp.data.msg;
        		  Page.notice(msg);
        		  $scope.depositOrderGrid.query();
              });
        },
        downloadFileTransfer : function(row){
      	  Page.ajaxPost('payOrder/downloadFileTransfer.do', row, function (resp) {
      		  Page.notice("文件已下载至D:\\transferFiles,请查看!")
            });
      }
    };
    

}]);
